package com.shishuo.cms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shishuo.cms.dao.CustomTagHtmlDao;
import com.shishuo.cms.entity.CustomTagHtml;
import com.shishuo.cms.entity.vo.PageVo;
@Service
public class CustomTagHtmlService extends BaseService<CustomTagHtml, Long>
{
	private CustomTagHtmlDao customTagHtmlDao;

	@Autowired
	public void setCustomTagHtmlDao(CustomTagHtmlDao customTagHtmlDao)
	{
		super.setBaseDao(customTagHtmlDao);
		this.customTagHtmlDao = customTagHtmlDao;
	}
	public boolean isExistByname(String name) {
		return customTagHtmlDao.getByName(name)==null?false:true;
	}
	public CustomTagHtml getByName(String name) {
		return customTagHtmlDao.getByName(name);
	}
	public PageVo<CustomTagHtml> getAllListPage(int pageNum)
	{
		PageVo<CustomTagHtml> pageVo = new PageVo<CustomTagHtml>(pageNum);
		List<CustomTagHtml> list = customTagHtmlDao
				.getAllList(pageVo.getOffset(), pageVo.getRows());
		pageVo.setList(list);
		pageVo.setCount(customTagHtmlDao.getAllListCount());
		return pageVo;
	}
}
